Updated for 2.6.1 by: The Tech Support Team, Pictorius Incorporated
Contents: Alert.pgs
Alert.rsrc
Alert ReadMe
Needs Prograph Extensions:
The default configuration of your 'Prograph Extensions' folder.
Needs Libraries to Compile:
SCLibrary 2.6
Library 2.6
Alert.rsrc
Standard Methods That Were Modified:
None
New Classes:
alert
Description
-----------
An example file with a class "alert" that allows the use of standard alert boxes within your Prograph Classic program.
How to Use in Your Program
-------------------------
The class "alert" has methods which get the alert message, check for errors while using class "alert" and display the alert box . Selectively load this class into your file and copy/build the needed resources into/in your file using ResEdit.
To create a new alert take a look at file "Alert.rsrc". You must supply a 'ALRT' resource and 'DITL' resource (use the existing resources as a template!). In interpreted mode you´ll have to copy this resources into your Prograp Classic file, in compiled mode it´s necessary to attach file "Alert.rsrc" to your Prograph Classic project.
To display an alert you have to call method "alert!" with specified alert message, 'ALRT' ID and the type of alert. There´re different possibilities available for specifying an alert message and an alert type, see below.
Alert Message: There are three possibilities to specify the alert message. You can specify a string, a 'STR ' resource ID or a list containing the 'STR#' resource ID and the string index.
Alert Type: 1 stands for a StopAlert, 2 for a NoteAlert and 3 for a CautionAlert. Specify one of these integers as needed and the proper icon is drawn into your alert box.
More Details
------------
You can specify the alert position (only under System 7.x) and the alert sound when you´re creating the alert resource.
The method "error?" uses 'ALRT' ID 400 and 'DITL' ID 400 to display alerts if something went wrong during running the methods "alert!" and "alert text?". MAKE SURE that these resources are AVAILABLE!